< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03010102.xhp

(section: msgbox) (bookmark: bm_id3153379)
MsgBox function

MsgBox 関数

MsgBox Function [Runtime]
MsgBox 関数 [実行時](hd_id3153379.1)

Displays a dialog box containing a message and returns a value.
メッセージ表示用のダイアログボックスを表示して、値を返します。(par_id3145171.2)

(/section: msgbox)

Syntax:
構文:(hd_id3156281.3)

MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]])
MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]])(par_id3154685.4)

Return value:
戻り値:(hd_id3153771.5)

Integer
整数(par_id3146985.6)

Parameter:
パラメータ:(hd_id3153363.7)

Text: String expression displayed as a message in the dialog box. Line breaks can be inserted with Chr$(13).
Text:ダイアログボックスにメッセージとして表示する文字列表式。表示メッセージを改行する場合は、該当箇所に Chr$(13) を挿入します。(par_id3153727.8)

DialogTitle: String expression displayed in the title bar of the dialog. If omitted, the name of the respective application is displayed.
DialogTitle:ダイアログボックスのタイトルバーに表示する文字列表式。これを省略した場合は、該当するアプリケーション名が表示されます。(par_id3147317.9)

Type: Any integer expression that specifies the dialog type and defines the number and type of buttons or icons displayed. Type represents a combination of bit patterns (dialog elements defined by adding the respective values):
Type:ダイアログ本体の種類および、ダイアログ上に表示するボタンの数と種類とアイコンを指定する整数表式。この Type の値は、ビットパターン (個々のダイアログ要素を示す値) を組み合わせて指定します。(par_id3153954.10)

Values
(par_id3154319.11)

0 : Display OK button only.
0 : OK ボタンのみを表示させます。(par_id3147397.12)

1 : Display OK and Cancel buttons.
1 : OK およびキャンセルの各ボタンを表示させます。(par_id3145646.13)

2 : Display Abort, Retry, and Ignore buttons.
2 : 中止、やり直し、および取消しの各ボタンを表示させます。(par_id3149410.14)

3 : Display Yes, No, and Cancel buttons.
3 : はい、いいえ、キャンセルの各ボタンを表示させます。(par_id3151075.15)

4 : Display Yes and No buttons.
4 : はい、いいえの各ボタンを表示させます。(par_id3153878.16)

5 : Display Retry and Cancel buttons.
5 : やり直しおよびキャンセルの各ボタンを表示させます。(par_id3155601.17)

16 : Add the Stop icon to the dialog.
16 : ダイアログ上にストップ記号のアイコンを表示させます。(par_id3150716.18)

32 : Add the Question icon to the dialog.
32 : ダイアログ上に疑問符のアイコンを表示させます。(par_id3153837.19)

48 : Add the Exclamation Point icon to the dialog.
48 : ダイアログ上にエクスクラメーション記号のアイコンを表示させます。(par_id3150751.20)

64 : Add the Information icon to the dialog.
64 : ダイアログ上にインフォメーション記号のアイコンを表示させます。(par_id3146915.21)

128 : First button in the dialog as default button.
128 : ダイアログ上の 1 番目のボタンを、標準ボタンとします。(par_id3145640.22)

256 : Second button in the dialog as default button.
256 : ダイアログ上の 2 番目のボタンを、標準ボタンとします。(par_id3153765.23)

512 : Third button in the dialog as default button.
512 : ダイアログ上の 3 番目のボタンを、標準ボタンとします。(par_id3153715.24)

Return value:
戻り値:(par_id3159267.25)

1 : OK
1 : OK(par_id3145230.26)

2 : Cancel
2 : キャンセル(par_id3149567.27)

3 : Abort
3 : 中止(par_id4056825.)

4 : Retry
4 : やり直し(par_id3155335.28)

5 : Ignore
5 : 無視 (する)(par_id3146918.29)

6 : Yes
6 : はい(par_id3155961.30)

7 : No
7 : いいえ(par_id3148488.31)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

Example:
例:(hd_id3150090.40)

Sub ExampleMsgBox
Sub ExampleMsgBox(par_id3154120.41)

Dim sVar as Integer
Dim sVar as Integer(par_id3145131.42)

sVar = MsgBox("Las Vegas")
sVar = MsgBox("Las Vegas")(par_id3151278.43)

sVar = MsgBox("Las Vegas",1)
sVar = MsgBox("Las Vegas",1)(par_id3149034.44)

sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title")
sVar = MsgBox( "Las Vegas",256 + 16 + 2,"Dialog title")(par_id3166424.45)

end sub
end sub(par_id3152581.46)


< Prev / Next >